#@ucenter_layout()


#define script()
<script>

    function doDel(id) {
        if (confirm('确定要删除该记录吗？删除后不可恢复')) {
            ajaxGet("#(CPATH)/ucenter/address/doDel/" + id)
        }
    }

</script>
#end


#define css()
<style>

    .card-dashboard {
        position: relative;
        border-radius: 3px;
        background: #ffffff;
        border: 1px solid #d2d6de;
        margin-bottom: 20px;
        width: 100%;
        card-shadow: 0 1px 1px rgba(0, 0, 0, 0);
    }

    .card-dashboard .card-header .card-title {
        display: inline-block;
        font-size: 14px;
        margin: 0;
        line-height: 1;
    }

</style>

#end

#define content()

<section class="content">

    <div class="container-fluid">
        <div class="card card-outline card-primary">
            <div class="card-header with-border">

                <div class="row admin-search-panel">
                    <div class="col-12">
                        <a href="#(CPATH)/ucenter/address/edit" class="btn btn-primary "> <i class="fas fa-plus"></i> 新建</a>
                    </div>
                </div>

            </div>
            <!-- /.card-header -->
            <div class="card-body p-0">

                <table class="table table-striped" id="table-address">
                    <thead>
                        <tr>
                            <th style="width: 150px">收货人</th>
                            <th style="width: 150px">手机号码</th>
                            <th >地址</th>
                            <th style="width: 100px">邮政编码</th>
                            <th style="width: 80px">是否默认</th>
                        </tr>
                    </thead>
                    <tbody>
                    #for(data : page.list)
                    <tr>
                        <td style="width: 50px">
                            <strong><a href="#">#(data.username ??)</a></strong>
                            <div class="jp-action-card">
                                <div class="jp-action-body">
                                    <a href="#(CPATH)/ucenter/address/edit?id=#(data.id)" style="color: #006505">编辑</a>|<a
                                        href="javascript:;" onclick="doDel('#(data.id)')" style="color: #a00">删除</a>
                                </div>
                            </div>
                        </td>
                        <td>
                            #(data.mobile ??)
                        </td>
                        <td>
                            #(data.province ??) &nbsp;#(data.city ??) &nbsp; #(data.district ??) &nbsp;#(data.detail ??)
                        </td>
                        <td>
                            #(data.zipcode ??)
                        </td>
                        <td>
                            #(data.width_default?'是':'否')
                        </td>
                    </tr>
                    #else
                    <tr class="nodata">
                        <td colspan="999">暂无数据</td>
                    </tr>
                    #end

                    </tbody>
                </table>
            </div>
            <!-- /.card-body -->
            <div class="card-footer">
                <div class="row">
                    <div class="col-sm-12">
                        #@_paginate()
                    </div>
                </div>
            </div>
            <!-- /.card-footer -->
        </div>
        <!-- /.card -->
    </div>
</section>
#end
